<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="p" uri="/WEB-INF/tld/page.tld" %>
<table class="table table-striped table-bordered bootstrap-datatable responsive">
    <thead>
    <tr>
    	<th></th>
        <th>上架票品名称</th>
        <th>所属景区</th>
        <th>零售价</th>
        <th>折扣</th>
        <th>可售数量</th>
        <th>上架时间</th>
        <th>有效时间</th>
        <th>上下架状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${onsaleTicketPage.list }" var="onsaleTicket">
    <tr>
    	<td><input type="checkbox"></td>
        <td>${onsaleTicket.name }</td>
        <td class="center">${onsaleTicket.scene.name }</td>
        <td class="center">${onsaleTicket.list_price }</td>
        <td class="center">${onsaleTicket.discount_display }折</td>
        <td class="center">${onsaleTicket.how_many_to_sell }</td>
        <td class="center">${onsaleTicket.launch_time_display }</td>
        <td class="center">${onsaleTicket.from_time_display }-${onsaleTicket.end_time_display }</td>
        <td class="center">${onsaleTicket.shelf_status }</td>
        <td class="center">
        	<a href="javascript:;" class="btn btn-default" 
        			onclick='changeShelfStatus("${onsaleTicket.on_sale_id}", "${onsaleTicket.isOK }");'>
	        	<c:choose>
	        		<c:when test="${onsaleTicket.isOK eq 1 }">下架</c:when>
	        		<c:when test="${onsaleTicket.isOK eq 0 }">重新上架</c:when>
	        	</c:choose>
	        </a>
        </td>
    </tr>
    </c:forEach>
    </tbody>
</table>
<p:page pageNo="${onsaleTicketPage.pageNo }" totalPage="${onsaleTicketPage.totalPage }" 
	totalRow="${onsaleTicketPage.totalRow }"/>
